﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Xml.Linq;
using System.Collections.ObjectModel;
using System.Web.UI.WebControls;
using System.IO;

namespace ProtoTypeService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IProtoTypeService
    {
        [OperationContract]
        string CreateForm(string formName, string description);

        [OperationContract]
        List<XElement> LoadformList();

        [OperationContract]
        string CreateFormControl(string formid, string controName, string contolType, string controldataType);

        [OperationContract]
        List<XElement> LoadformControlList(string formid);

        [OperationContract]
        string SetformLayout(string formid, string layouttype);

        [OperationContract]
        string SetformDetailLayout(string formid, string detaillayouttype);

        [OperationContract]
        void SetBindingelements(string formid, string tag, string Selecteditem, string cName);

        [OperationContract]
        void SetDetailBindingelements(string formid, string tag, string Selecteditem, string cName);

        [OperationContract]
        string GetSelectedLayOutType(string formId);

        [OperationContract]
        string GetSelectedDetailLayOutType(string formId);

        [OperationContract]
        void SaveModifiedlayout(string formId, string xamltemplate);

        [OperationContract]
        string GetModufiedTemplate(string formId);

        [OperationContract]
        Dictionary<string, string> AddFormItemDetails(Dictionary<string, string> items, string formid);

        [OperationContract]
        ObservableCollection<XElement> GetSelectedFormItemDetails(string formid);

        [OperationContract]
        string GetSelectedformName(string formid);


        [OperationContract]
        string GetSelectedControlType(string formid, string controlname);

        [OperationContract]
        string UpdateFormField(string formid, string controlid, string fieldname, string fieldtype);

        [OperationContract]
        ObservableCollection<XElement> LoadlayoutControls(string formid);

        //get selected formname & Layouttype
        [OperationContract]
        void GetSelectedFormData(string formid, out string formname, out string selectedlayout);
        // TODO: Add your service operations here

        [OperationContract]
        void Savedatainwebservice(Stream myStream);

        [OperationContract]
        void SavefilestoCloud(byte[] myStream, string filename);

    }

}
